<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    <title>查询员工列表</title>
 
    <link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>
<!-- 导航 -->
    <nav class="navbar navbar-default ">
      <div class="container">
        <!-- 小屏幕按钮和logo -->
        <div class="navbar-header">
          <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a href="#" class="navbar-brand">RM admin</a>
        </div>
        <!-- 小屏幕按钮和logo -->
        <!-- 导航 -->
        <div class="collapse navbar-collapse">
           <ul class=" nav navbar-nav ">
             <li class="active"><a href="#"><span class="glyphicon glyphicon-home"></span> &nbsp;后台首页</a></li>
             <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    组织结构管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/organization/department">部门管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/organization/job">岗位管理</a></li>

                </ul>
            </li>
            <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    人事信息管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/employee/enterAddEmployee">员工入职管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/period/enterPeriod/">试用期管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/dept/out">部门调动管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/post/out">岗位调动管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/leave/out">员工离职管理</a></li>

                </ul>
            </li>
             <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    员工信息中心
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/infoemployee/list">员工信息中心</a></li>


                </ul>
            </li>
            <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    报表管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/statement/newHire">新聘员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/departure">离职员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/deptTurn">部门调动员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/postTurn">岗位调动员工报表</a></li>
                </ul>
            </li>
           </ul>
           <ul class=" nav navbar-nav navbar-right ">
             <li class="dropdown">
                <a href="#" class=" dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">admin
                    <span class="caret"></span>
                </a>
            </li>

             <li><a href="http://localhost:8080/PMsystem/admin/exit"><span class="glyphicon glyphicon-off"></span>&nbsp;退出</a></li>
           </ul>
        </div>
        <!-- 导航 -->
      </div>
    </nav>
   <!-- 导航 -->
   <div class="container-fluid">
       <div class="row">
           <div class="col-md-2">
               <div class="panel-group" id="accordion">
                   <div class="panel panel-default">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThree" style="text-decoration: none;">
                                查询员工列表
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThree" class="panel-collapse collapse in">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/leave/out"" style="text-decoration: none;">员工离职</a></td>
                                </tr>


                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>



                  <div class="panel panel-default">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThreeo" style="text-decoration: none;">
                           已调动岗位员工查询
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThreeo" class="panel-collapse collapse in">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/leave/leaveQuery"" style="text-decoration: none;">已离职员工查询</a></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>

              </div>

           </div>
           <div class="col-sm-10">
                      <!-- 主体内容 -->
           <div class="panel panel-info">
              <div class="panel-heading">
                  <h3 class="panel-title">查询员工</h3>
              </div>
              <div class="panel-body">
                  <form class="form-inline" role="form" action="${pageContext.request.contextPath }/leave/getRequire" method="POST">
                    <div class="col-md-6">
                      
                        <div class="input-group">
                           <span class="input-group-addon">员工姓名</span>
                           <input type="text" class="form-control" placeholder="请输入员工姓名" name="emp_name">
                       </div><br><br>
                       <div class="input-group">
                           <span class="input-group-addon">员工编号</span>
                           <input type="text" class="form-control" placeholder="请输入员工编号" name="emp_id">
                       </div>
                     <br><br>
                     <div class="input-group">
                          <button type="submit" class="btn btn-primary">查询</button>
                      </div>
                    </div>

                    <div class="col-md-6">
                      <div class="row">
                        <div class="input-group">
                            <span class="input-group-addon">部门名称</span>
                            <select class="form-control" style="width: 200px;" name="dept_name">
                        <option value=""></option>
                        <c:forEach items="${departments }" var="departments">
                        <option value="${departments.dept_name }">${departments.dept_name }</option>
                        </c:forEach>
                        </select>
                        </div><br><br>
                        <div class="input-group">
                            <span class="input-group-addon">部门编号</span>
                            <input type="text" class="form-control" placeholder="请输入部门编号" name="dept_id">
                        </div>
                      </div>

                    </div>
                  </form>
              </div>
          </div>
           <div class="panel panel-success">
              <div class="panel-heading">
                  <h3 class="panel-title">员工列表</h3>
              </div>
              <div class="panel-body">
                    <table class="table table-hover">

                        <thead>
                          <tr>
	                        <th>员工号</th>
                            <th>员工姓名</th>
                            <th>员工性别</th>
                            <th>部门编号</th>
							<th>员工部门</th>							
                            <th>操作</th>
                          </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${employees }" var="employees">
						   <tr>
							   <td>${employees.emp_id }</td>
							   <td>${employees.emp_name }</td>
							   <td>${employees.emp_sex }</td>
							   <td>${employees.emp_dept}</td>
							   <td>${employees.department.dept_name }</td>
							   <td>
							   
							    <button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal" onclick="chuanshu(${employees.emp_id})">离职</button> 
							   </td>
						   </tr>
						   </c:forEach>

						   </tbody>
                      </table>
					 
              </div>
	   </div>
          
          
          
          
          
          
</div>
</div>
</div>      
       
             

   <!-- 模态框（Modal） -->
   <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
       <div class="modal-dialog">
           <div class="modal-content">
               <div class="modal-header">
                   <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                   <h4 class="modal-title" id="myModalLabel">离职信息</h4>
               </div>
               <form class="bs-example bs-example-form" role="form" action="${pageContext.request.contextPath }/leave/updateAndAdd" method="POST">
               <div class="modal-body">
                 <div >
                     
                         <div class="input-group">
                             <span class="input-group-addon">离职日期</span>
                             <input type="date" class="form-control" placeholder="YYYY-MM-DD" name="el_date">
                         </div>
                         <br>
                         <div class="input-group">
                             <span class="input-group-addon">离职类型</span>							
								<select class="form-control" name="el_type">
									<option value=""></option>
									<option value="辞退">辞退</option>
									<option value="主动辞退">主动辞退</option>
									<option value="退休">退休</option>
									<option value="开除">开除</option>
									<option value="试用期未通过">试用期未通过</option>
								</select>
								
						 </div>					 
                         <br>
                         <div class="input-group">
                             <span class="input-group-addon">离职去向</span>
                             <input type="text" class="form-control" placeholder="请输入离职去向" name="el_away">
                         </div>
                         <br>
                         <div class="input-group">
                             <span class="input-group-addon">备注</span>
                             <input type="text" class="form-control" placeholder="请输入..." name="el_remark">
                         </div>
                        <input id="ddd" type="hidden" name="el_emp_id">

                     
                 </div>
               </div>
               <div class="modal-footer">
                   <button type="submit" class="btn btn-info">提交</button>
                   <button type="reset" class="btn btn-default" data-dismiss="modal">关闭</button>

               </div>
               </form>
           </div><!-- /.modal-content -->
       </div><!-- /.modal -->
   </div>



    <script src="<%=basePath%>js/jquery-3.2.1.min.js"></script>

    <script src="<%=basePath%>js/bootstrap.min.js"></script>
    
    <script type="text/javascript">
      function chuanshu(id){
    	  $("#ddd").val(id);
    	  
      }
    </script>
    
  </body>
</html>
